//
//  DetailOfCircle.m
//  LoveOfPet
//
//  Created by 芦彬 on 15/11/18.
//  Copyright © 2015年 孔维. All rights reserved.
//

#import "DetailOfCircle.h"

@implementation DetailOfCircle

- (void)dealloc{
    [_avatar release];
    [_disname release];
    [_photo release];
    [_photo_des release];
    [_pid release];
    [_picheight release];
    [_picwidth release];
    [_ppid release];
    [_uid release];
    [_plnum release];
    [_sex release];
    [_time release];
    [_zan release];
    [_commentsArray release];
    [_visitnum release];
    [super dealloc];
}

- (instancetype)initWithDictionary:(NSDictionary *)dic{
    self = [super init];
    if (self) {
        self.commentsArray = [NSMutableArray array];
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}

+ (DetailOfCircle *)detailOfCircleWithDictionary:(NSDictionary *)dictionary{
    DetailOfCircle *detailOfCircle = [[DetailOfCircle alloc]initWithDictionary:dictionary];
    return [detailOfCircle autorelease];
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key{
    
}

- (void)setValue:(id)value forKey:(NSString *)key{
    if ([key isEqualToString:@"comments"]) {
        for (NSDictionary *dic in value) {
            Comments *comment = [Comments commentsWithDictionary:dic];
            [self.commentsArray addObject:comment];
        }
    }else{
        [super setValue:value forKey:key];
    }
}

@end
